package com.cloudbroker.bcs.platform.ltb.middle.service.impl;

import com.cloudbroker.bcs.common.dao.base.DAOBase;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.viewpoint.vo.ViewpointPublicManageQryForm;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.viewpoint.vo.ViewpointQueryForm;
import com.cloudbroker.bcs.platform.ltb.middle.dao.ViewpointMsgDAO;
import com.cloudbroker.bcs.platform.ltb.middle.entity.ViewpointMsg;
import com.cloudbroker.bcs.platform.ltb.middle.entityview.ViewpointUserView;
import com.cloudbroker.bcs.platform.ltb.middle.service.ViewpointMsgService;
import com.cloudbroker.bcs.platform.ltb.middle.service.base.TenantServiceImplBase;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by world on 16/7/8.
 */
@Service
public class ViewpointMsgServiceImpl extends TenantServiceImplBase<ViewpointMsg, String>
    implements ViewpointMsgService {

    @Resource
    private ViewpointMsgDAO viewpointMsgDAO;
    @Override
    protected DAOBase<ViewpointMsg, String> getDAO() {
        return viewpointMsgDAO;
    }

    @Override
    public List<ViewpointMsg> queryByKeyWord(ViewpointQueryForm viewpointQueryForm) {
        return viewpointMsgDAO.queryByKeyWord(viewpointQueryForm);
    }

    @Override
    public int countByKeyword(ViewpointQueryForm viewpointQueryForm) {
        return viewpointMsgDAO.countByKeyWord(viewpointQueryForm);
    }
    @Override
    public long saveViewpoint(ViewpointMsg viewpointMsg) {
        return viewpointMsgDAO.saveViewpoint(viewpointMsg);
    }

    @Override
    public List<ViewpointUserView> queryByPublicManage(ViewpointPublicManageQryForm form){
        return viewpointMsgDAO.queryByPublicManage(form);
    }
    @Override
    public int countByPublicManage(ViewpointPublicManageQryForm form) {
        return viewpointMsgDAO.countByPublicManage(form);

    }

}
